<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="u" uri="/WEB-INF/tld/unit.tld" %>
 <title>正在打印</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script language="javascript" src="${basePath }/js/LodopFuncs.js"></script>
<object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="${basePath }/jsp/print/install_lodop.exe"></embed>
</object> 
</head>
<body>
	<div id="image_print">
		<img width="70px" src="${basePath }/image/fhh01.jpg"></img>
	</div>
	<div id="mian_print">
			<div align="center" style="font-size:10px;">
			= = = = = = = = = = = = = = = = = = 
			</div>
			<div style="margin-left:20px;margin-right:10px;">
			<table with="180"  style="font-size:10px;">
			<tr class="">
              <th align="center" >商品名称</th>
              <th align="center">批次</th>
              <th align="center">类型</th>
              <th align="center">金额</th>
            </tr>
            <c:forEach items="${detail.products }" var="product" varStatus="status">
            <tr class="">
              <td align="left">${product.product_name }</td>
              <td align="center">${product.batch }</td>
              <td align="center">${product.myunit }</td>
              <td align="center">${product.now_price }</td>
            </tr>
            </c:forEach>
            <c:forEach items="${detail.saves }" var="save" varStatus="status">
            <tr class="">
              <td align="left">${save.product_name }</td>
              <td align="center">${save.batch }</td>
              <td align="center">${save.myunit }</td>
              <td align="center">${save.now_price }</td>
            </tr>
            </c:forEach>
			</table>
			</div>
			<div align="center" >
			-------------------------
			</div>
            <table width="180" style="font-size:10px;">
              <tr>
                <th  align="center"></th>
              </tr>
              <!-- 
              <tr>
                <th  align="center">结账信息</th>
              </tr>
               -->
              <tr >
                <td align="left" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;销售总金额：<em>${detail.order.sum_amount }</em>元</td>
              </tr>
              <tr >
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;消费商品金额：<em>${detail.order.sum_buy }</em>元</td>
              </tr>
              <tr >
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;寄存商品金额：<em>${detail.order.sum_save }</em>元</td>
              </tr>
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;现金支付：${detail.order.pay_amount }</td>
              </tr>
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;银行刷卡：${detail.order.bank_amount }</td>
              </tr>
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;会员刷卡：${detail.order.vip_amount }</td>
              </tr>
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;抹零：${detail.order.wipe_amount }</td>
              </tr>
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;应收金额：${detail.order.pay_amount }</td>
              </tr>
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;交易时间：${detail.order.order_date }</td>
              </tr>
              <!-- 
              <tr>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;卡号：${detail.order.vip_no }</td>
              </tr>
               -->
          </table>
          <div align="center" style="font-size:10px;">
			= = = = = = = = = = = = = = = = = = 
			</div>
			<div align="center" style="font-size:10px;">
				谢谢您的惠顾，欢迎再次光临！
			</div>
      </div>
</body>
<script type="text/javascript">
	var LODOP;
	cssStyle = "<style>table{font-size:10px;}</style>";
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'),'${basePath }');
	if(LODOP.PRINT_INIT("")){
		LODOP.SET_PRINT_PAGESIZE(0,"50mm","150mm","");
		LODOP.ADD_PRINT_IMAGE("0mm","30mm","20mm","20mm",document.getElementById("image_print").innerHTML);
		LODOP.ADD_PRINT_HTM("21mm","0mm","50mm","80mm",document.getElementById("mian_print").innerHTML);
		LODOP.SET_PRINTER_INDEX(-1);
		//LODOP.PREVIEWB();
		LODOP.PRINTB();
	}else{
		alert("打印控件初始化失败，请重新刷新后再试。");
	}
	window.close();
</script>
